package com.example.aptech2008_hellofragment;

import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;

@SuppressLint("NewApi")
public class Fragment2 extends Fragment {
	public static final String KEY_NAME = "name";

	public Fragment2() {

	}

	public static Fragment2 newInstante(String name) {
		Fragment2 fragment2 = new Fragment2();
		Bundle bundle = new Bundle();
		bundle.putString(KEY_NAME, name);
		fragment2.setArguments(bundle);
		return fragment2;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View root = inflater.inflate(R.layout.layout_fm2, container, false);
		TextView txt = (TextView) root.findViewById(R.id.textView1);
		txt.setText(getArguments().getString(KEY_NAME));
		return root;
	}

}
